package com.google.android.gms.internal;

import com.google.android.exoplayer2.extractor.ts.TsExtractor;
import java.io.IOException;

public final class zzjk extends zzflm<zzjk> {
    private Integer zzbei = null;
    public String zzbej = null;
    private Integer zzbek = null;
    private Integer zzbel = null;
    private zzjv zzbem = null;
    public long[] zzben = zzflv.zzpvz;
    public zzji zzbeo = null;
    private zzjj zzbep = null;
    private zzjo zzbeq = null;
    public zzjd zzber = null;

    public zzjk() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    /* access modifiers changed from: private */
    /* renamed from: zzm */
    public final zzjk zza(zzflj zzflj) throws IOException {
        zzfls zzfls;
        while (true) {
            int zzcxx = zzflj.zzcxx();
            switch (zzcxx) {
                case 0:
                    return this;
                case 72:
                    this.zzbei = Integer.valueOf(zzflj.zzcym());
                    continue;
                case 82:
                    this.zzbej = zzflj.readString();
                    continue;
                case 88:
                    this.zzbek = Integer.valueOf(zzflj.zzcym());
                    continue;
                case 96:
                    int position = zzflj.getPosition();
                    try {
                        this.zzbel = Integer.valueOf(zzjc.zzd(zzflj.zzcym()));
                        continue;
                    } catch (IllegalArgumentException unused) {
                        zzflj.zzmw(position);
                        zza(zzflj, zzcxx);
                        break;
                    }
                case 106:
                    if (this.zzbem == null) {
                        this.zzbem = new zzjv();
                    }
                    zzfls = this.zzbem;
                    break;
                case 112:
                    int zzb = zzflv.zzb(zzflj, 112);
                    int length = this.zzben == null ? 0 : this.zzben.length;
                    long[] jArr = new long[(zzb + length)];
                    if (length != 0) {
                        System.arraycopy(this.zzben, 0, jArr, 0, length);
                    }
                    while (length < jArr.length - 1) {
                        jArr[length] = zzflj.zzcyr();
                        zzflj.zzcxx();
                        length++;
                    }
                    jArr[length] = zzflj.zzcyr();
                    this.zzben = jArr;
                    continue;
                case 114:
                    int zzli = zzflj.zzli(zzflj.zzcym());
                    int position2 = zzflj.getPosition();
                    int i = 0;
                    while (zzflj.zzcyo() > 0) {
                        zzflj.zzcyr();
                        i++;
                    }
                    zzflj.zzmw(position2);
                    int length2 = this.zzben == null ? 0 : this.zzben.length;
                    long[] jArr2 = new long[(i + length2)];
                    if (length2 != 0) {
                        System.arraycopy(this.zzben, 0, jArr2, 0, length2);
                    }
                    while (length2 < jArr2.length) {
                        jArr2[length2] = zzflj.zzcyr();
                        length2++;
                    }
                    this.zzben = jArr2;
                    zzflj.zzlj(zzli);
                    continue;
                case 122:
                    if (this.zzbeo == null) {
                        this.zzbeo = new zzji();
                    }
                    zzfls = this.zzbeo;
                    break;
                case TsExtractor.TS_STREAM_TYPE_HDMV_DTS:
                    if (this.zzbep == null) {
                        this.zzbep = new zzjj();
                    }
                    zzfls = this.zzbep;
                    break;
                case TsExtractor.TS_STREAM_TYPE_DTS:
                    if (this.zzbeq == null) {
                        this.zzbeq = new zzjo();
                    }
                    zzfls = this.zzbeq;
                    break;
                case 146:
                    if (this.zzber == null) {
                        this.zzber = new zzjd();
                    }
                    zzfls = this.zzber;
                    break;
                default:
                    if (!super.zza(zzflj, zzcxx)) {
                        return this;
                    }
                    continue;
            }
            zzflj.zza(zzfls);
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzbei != null) {
            zzflk.zzad(9, this.zzbei.intValue());
        }
        if (this.zzbej != null) {
            zzflk.zzp(10, this.zzbej);
        }
        if (this.zzbek != null) {
            int intValue = this.zzbek.intValue();
            zzflk.zzac(11, 0);
            zzflk.zzmy(intValue);
        }
        if (this.zzbel != null) {
            zzflk.zzad(12, this.zzbel.intValue());
        }
        if (this.zzbem != null) {
            zzflk.zza(13, (zzfls) this.zzbem);
        }
        if (this.zzben != null && this.zzben.length > 0) {
            for (long zza : this.zzben) {
                zzflk.zza(14, zza);
            }
        }
        if (this.zzbeo != null) {
            zzflk.zza(15, (zzfls) this.zzbeo);
        }
        if (this.zzbep != null) {
            zzflk.zza(16, (zzfls) this.zzbep);
        }
        if (this.zzbeq != null) {
            zzflk.zza(17, (zzfls) this.zzbeq);
        }
        if (this.zzber != null) {
            zzflk.zza(18, (zzfls) this.zzber);
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzbei != null) {
            zzq += zzflk.zzag(9, this.zzbei.intValue());
        }
        if (this.zzbej != null) {
            zzq += zzflk.zzq(10, this.zzbej);
        }
        if (this.zzbek != null) {
            zzq += zzflk.zzlw(11) + zzflk.zzmf(this.zzbek.intValue());
        }
        if (this.zzbel != null) {
            zzq += zzflk.zzag(12, this.zzbel.intValue());
        }
        if (this.zzbem != null) {
            zzq += zzflk.zzb(13, (zzfls) this.zzbem);
        }
        if (this.zzben != null && this.zzben.length > 0) {
            int i = 0;
            for (long zzdj : this.zzben) {
                i += zzflk.zzdj(zzdj);
            }
            zzq = zzq + i + (1 * this.zzben.length);
        }
        if (this.zzbeo != null) {
            zzq += zzflk.zzb(15, (zzfls) this.zzbeo);
        }
        if (this.zzbep != null) {
            zzq += zzflk.zzb(16, (zzfls) this.zzbep);
        }
        if (this.zzbeq != null) {
            zzq += zzflk.zzb(17, (zzfls) this.zzbeq);
        }
        return this.zzber != null ? zzq + zzflk.zzb(18, (zzfls) this.zzber) : zzq;
    }
}
